fix(deps): bump drizzle-orm 0.45.2 + adopt MCP SDK 1.25.3 native types#4252
fix(deps): bump drizzle-orm 0.45.2 + adopt MCP SDK 1.25.3 native types#4252waleedlatif1 merged 5 commits intostagingfrom
Conversation
Resolves Dependabot alert #98. Drizzle ORM <0.45.2 improperly escaped quoted SQL identifiers, allowing SQL injection via untrusted input passed to APIs like sql.identifier() or .as(). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…25.3 bump Replace hand-written schema/annotation shapes with the SDK's exported Tool, JSONRPCResultResponse, and Tool['annotations'] types so changes upstream flow through automatically. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace hand-written interfaces that duplicated schema shape with typeof table.$inferSelect aliases for webhook, workflow, and workspaceFiles rows. Also simplify metadata insert/update to use .returning() instead of field-by-field copies. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Cleans up several areas to use Drizzle schema-inferred row types ( Reviewed by Cursor Bugbot for commit 3bb327f. Configure here. |
Greptile SummaryThis PR bundles a security patch ( Confidence Score: 5/5Safe to merge — security fix, clean type alignment, and no behavioral regressions identified. All changes are well-scoped: the drizzle bump is a security patch with no breaking API changes; the MCP SDK type renames are mechanical; the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[insertFileMetadata] --> B{Key exists and deletedAt set?}
B -->|Yes| C[UPDATE with returning]
C --> D{restored defined?}
D -->|Yes| E[return restored]
D -->|No: concurrent hard-delete| F
B -->|No| F{Key exists not deleted?}
F -->|Yes| G[return existing record]
F -->|No| H[INSERT with returning]
H --> I{Success?}
I -->|Yes| J[return inserted]
I -->|No: 23505 race| K[SELECT after error]
K --> L{Found?}
L -->|Yes| M[return existingAfterError]
L -->|No| N[throw error]
Reviews (2): Last reviewed commit: "chore(uploads): align metadata.ts with g..." | Re-trigger Greptile |
…ard delete If a hard delete races between the initial SELECT and the restore UPDATE, .returning() yields no row. Previously the function would return undefined and silently violate the Promise<FileMetadataRecord> contract. Now the function falls through to the INSERT path, which already handles uniqueness races via the 23505 catch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace dynamic uuid import with generateId() per @sim/utils/id convention, narrow the error catch off `any`, and convert the inline comment to TSDoc. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3bb327f. Configure here.
Summary
drizzle-orm0.44.5 → 0.45.2 to patch GHSA-gpj5-g38j-94v9 (SQL injection viaescapeNametypo, CVSS 7.5). No breaking changes affect our usage — all.as()callsites use literal aliases.@modelcontextprotocol/sdk1.25.3 types —JSONRPCResultResponse(renamed fromJSONRPCResponse),Tool['inputSchema'], andTool['annotations']replace hand-written shapes. Drop spurioustools: {}from client capabilities (it's a server capability).WebhookRecord/WorkflowRecord/FileMetadataRecord/PolledWebhook*interfaces withtypeof table.$inferSelectaliases, removing severalas unknown as ...casts. The hand-written types had drifted (e.g. they declaredworkspaceId: stringwhen the column is nullable); the schema-derived types are honest, and one consumer site (processPolledWebhookEvent) now correctly handlesstring | nullvia?? undefined.insertFileMetadatato use.returning()instead of field-by-field copies (-75 lines). All idempotency paths preserved (restore-deleted, return-existing, 23505 race).Test plan
tsc --noEmitclean acrossapps/sim+packages/dbbun.lockresolves a singledrizzle-orm@0.45.2;@browserbasehq/stagehandkeeps its own nested MCP SDK 1.20.2 (separate copy, by design)serveroute